home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Development Tools & Languages / Windoid / Windoid.r < prev    next >
Encoding:
Text File  |  1995-02-13  |  9.7 KB  |  341 lines  |  [TEXT/MPS ]

  1. // Copyright © 1991 by Apple Computer, Inc.  All rights reserved. 
  2. // Windoid.r file.
  3.  
  4. // INCLUDES ---------------------------------------------------------------------------------
  5. // Auto-Include the requirements for this source
  6.  
  7. #ifndef __TYPES.R__
  8. #include "Types.r"
  9. #endif
  10.  
  11. #ifndef __SYSTYPES.R__
  12. #include "SysTypes.r"                // needed for version resource
  13. #endif        
  14.  
  15. #ifndef __MacAppTypes__
  16. #include "MacAppTypes.r"
  17. #endif
  18.  
  19. #if qTemplateViews
  20. #ifndef __ViewTypes__
  21. #include "ViewTypes.r"
  22. #endif
  23. #endif
  24.  
  25. #if qDebug
  26. include "Debug.rsrc";
  27. #endif
  28.  
  29. #include "WindoidRez.h"                // common header file for resource IDs
  30.  
  31.  
  32. // RESOURCES -------------------------------------------------------------------------------
  33.  
  34. include "MacApp.rsrc";
  35. include "Printing.rsrc";
  36. include "FloatWindow.rsrc";            // floating window resources
  37.  
  38.  
  39. // CODE ------------------------------------------------------------------------------------
  40.  
  41. #if !qPowerPC
  42. include $$Shell("ObjApp")"Windoid" 'CODE';
  43. #endif
  44.  
  45.  
  46. // SIZE ------------------------------------------------------------------------------------
  47.  
  48. resource 'SIZE' (-1) {
  49.     saveScreen,
  50.     acceptSuspendResumeEvents,
  51.     enableOptionSwitch,
  52.     canBackground,
  53.     doesActivateOnFGSwitch,
  54.     backgroundAndForeground,
  55.     dontGetFrontClicks,
  56.     ignoreAppDiedEvents,
  57.     is32BitCompatible,
  58.     isHighLevelEventAware,
  59.     localAndRemoteHLEvents,
  60.     isStationeryAware,                
  61.     reserved,
  62.     reserved,
  63.     reserved,
  64.     reserved,
  65. #if qModelFarCode
  66.     1550 * 1024,
  67.     1500 * 1024,
  68. #elif qDebug
  69.     1500 * 1024,
  70.     1475 * 1024
  71. #else
  72.     1375 * 1024,
  73.     1350 * 1024
  74. #endif
  75. };
  76.  
  77. /*--------------------------------------------------------------------------------
  78.     memory stuff
  79. --------------------------------------------------------------------------------*/
  80. resource 'mem!' (132,
  81. #if qNames
  82.     "Additional Stack Space",
  83. #endif
  84.     purgeable) {
  85.     0,                // Add to object heap size
  86.     0,                // Add to heap increment size
  87.     0,                // Add to temporary reserve
  88.     0,                // Add to permanent reserve
  89.     49152            // Add to stack space
  90. };
  91.  
  92.  
  93.  
  94. /*    Printing to the LaserWriter is the time when the most temporary memory
  95.     is in use.  We need the segments in use at that time */
  96.  
  97. resource 'seg!' (256, purgeable) {
  98.     {
  99.         "GNonRes";
  100.         "GClipboard";
  101.         "GClose";
  102.         "GFile";
  103.         "GOpen";
  104.         "GReadFile";
  105.         "GSelCommand";
  106.         "GFinder";
  107.         "GWriteFile";
  108.         "BBNonRes";
  109.         "BBOpen";
  110.         "GNonRes2";
  111.         "GPrint";
  112.         "GReadResource";
  113.         "TESelCommand";
  114.     }
  115. };
  116.  
  117. #if qPowerPC
  118. #include "CodeFragmentTypes.r"
  119.  
  120. resource 'cfrg' (0, "Configuration Info") {
  121.     {
  122.         kPowerPC,
  123.         kFullLib,
  124.         kNoVersionNum,
  125.         kNoVersionNum,
  126.         0,
  127.         0,
  128.         kIsApp,
  129.         kOnDiskFlat,
  130.         kZeroOffset,
  131.         kWholeFork,
  132.         "Windoid"
  133.     }
  134. };
  135. #endif
  136.  
  137.  
  138. // VERS ------------------------------------------------------------------------------------
  139. // Get the default Version resources
  140.  
  141. include "Defaults.rsrc"  'vers' (1);                // application or file specific
  142.  
  143.  
  144. // ALERTS AND DLOGS ------------------------------------------------------------------------
  145.  
  146. include "Defaults.rsrc" 'ALRT'    (phAboutApp);        // About… window
  147. include "Defaults.rsrc" 'DITL'    (phAboutApp);        // About… contents
  148. include "Defaults.rsrc" 'STR#'    (kDefaultCredits);    // credits
  149.  
  150.  
  151. // ICONs and BUNDLEs -----------------------------------------------------------------------
  152. // Get the default MacApp® application icon and file reference
  153.  
  154. include "Defaults.rsrc"  'ICN#' (128);
  155. include "Defaults.rsrc"  'FREF' (128);
  156.  
  157.  
  158. // CMNUs -----------------------------------------------------------------------------------
  159.  
  160. include "Defaults.rsrc" 'CMNU' (mApple);            // grab the default Apple/File menus
  161.  
  162. resource 'CMNU' (mFile,
  163. #if qNames
  164. "mFile",
  165. #endif
  166. nonpurgeable) {
  167.     mFile,
  168.     textMenuProc,
  169.     EnablingManagedByMacApp,
  170.     enabled,
  171.     "File",
  172.     {
  173.     "New",                noIcon, "N",    noMark, plain, cNew;
  174.     "Close",            noIcon, "W",    noMark, plain, cClose;
  175.     "-",                noIcon, noKey,    noMark, plain, nocommand;
  176.     "Quit",                noIcon, "Q",    noMark, plain, cQuit
  177.     }
  178. };
  179.  
  180.  
  181. resource 'CMNU' (mWindoid,
  182. #if qNames
  183. "mWindoid",
  184. #endif
  185. nonpurgeable) {
  186.     mWindoid,
  187.     textMenuProc,
  188.     EnablingManagedByMacApp,
  189.     enabled,
  190.     "Windoid",
  191.      {
  192.     "Green",            noIcon, noKey, noMark, plain, cGreen;
  193.     "Yellow",            noIcon, noKey, noMark, plain, cYellow;
  194.     "Red",                noIcon, noKey, noMark, plain, cRed;
  195.     }
  196. };
  197.  
  198. resource 'CMNU' (mNormalMenu,
  199. #if qNames
  200. "mNormalMenu",
  201. #endif
  202. nonpurgeable) {
  203.     mNormalMenu,
  204.     textMenuProc,
  205.     EnablingManagedByMacApp,
  206.     enabled,
  207.     "Set Light",
  208.      {
  209.     /* [1] */    "Green",                noIcon, "G", noMark, plain, cNormGreen;
  210.     /* [2] */    "Yellow",                noIcon, "Y", noMark, plain, cNormYellow;
  211.     /* [3] */    "Red",                    noIcon, "R", noMark, plain, cNormRed
  212.     }
  213. };
  214.  
  215.  
  216. // MBARs -----------------------------------------------------------------------------------
  217. // Displayed menus 
  218.  
  219. resource 'MBAR' (kMBarDisplayed,
  220. #if qNames
  221. "Windoid",
  222. #endif
  223.     purgeable) {
  224.     {mApple; mFile; mWindoid; mNormalMenu}
  225.     
  226. };
  227.  
  228.  
  229. resource 'TxSt' (1000, purgeable) {
  230.     tsPlain,
  231.     0,
  232.     {    /* array: 3 elements */
  233.         /* [1] */
  234.         0x0,
  235.         /* [2] */
  236.         0x0,
  237.         /* [3] */
  238.         0x0
  239.     },
  240.     "Chicago"
  241. };
  242.  
  243.  
  244. resource 'View' (1001, purgeable) {MAThreeOh, 
  245.     {
  246.     ViewSignatureAndClassname
  247.         {'wind', 647, "", 'WIND', enabled, noIdle, {}, MAThreeOh, 
  248.         {50, 20}, {200, 350}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  249.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  250.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  251.         NoDrawingEnvironment {}, 
  252.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  253.             AdornFirst, AdornerLocalObject {EraseAdorner}, 
  254.             DrawView, AdornerLocalObject {DrawAdorner}, 
  255.             AdornLast, AdornerLocalObject {ResizeIconAdorner}}}, emptyUserArea, 
  256.         Window {zoomDocProc, 'DFLT', goAwayBox, resizable, ignoreFirstClick, 
  257.             freeOnClosing, disposeOnFree, closesDocument, openWithDocument, dontAdaptToScreen, stagger, forceOnScreen, 
  258.             dontCenter, doesntFloat, doesntHideOnSuspend, generateActivates, filler, 1006, 2}, 3}, 
  259.     ViewSignatureAndClassname
  260.         {'scrl', 183, "", 'SCLR', enabled, noIdle, {}, MAThreeOh, 
  261.         {0, 0}, {185, 335}, sizeRelSuperView, sizeRelSuperView, shown, doesntWantToBeTarget, 
  262.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  263.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  264.         NoDrawingEnvironment {}, 
  265.         NoAdorners {}, emptyUserArea, 
  266.         Scroller {'vCLR', 'hCLR', {150, 320}, {16, 16}, VertConstrain, HorzConstrain, noInset, respondsToFKeys}, 1}, 
  267.     ViewSignatureAndClassname
  268.         {'inc@', 72, "", noID, notEnabled, noIdle, {}, MAThreeOh, 
  269.         {0, 0}, {150, 320}, sizeFixed, sizeFixed, shown, doesntWantToBeTarget, 
  270.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  271.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  272.         NoDrawingEnvironment {}, 
  273.         NoAdorners {}, emptyUserArea, 
  274.         IncludeAt {1002, {0, 0}}, 
  275.         NoSubviews}, 
  276.     ViewSignatureAndClassname
  277.         {'ssbr', 159, "", 'hCLR', enabled, noIdle, {}, MAThreeOh, 
  278.         {185, -1}, {16, 337}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  279.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  280.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  281.         NoDrawingEnvironment {}, 
  282.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  283.             DrawView, AdornerLocalObject {DrawAdorner}, 
  284.             AdornAfter, AdornerSignatureAndClassname {'comp', "", 'comp', freeOnDeletion, $"02"}}}, emptyUserArea, 
  285.         ScrollerScrollBar {mHScrollBarHit, notHilited, notDimmed, sizeable, noInset, 1000, dontPreferOutline, h, 0, 0, 0}, 
  286.         NoSubviews}, 
  287.     ViewSignatureAndClassname
  288.         {'ssbr', 159, "", 'vCLR', enabled, noIdle, {}, MAThreeOh, 
  289.         {-1, 335}, {187, 16}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  290.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  291.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  292.         NoDrawingEnvironment {}, 
  293.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  294.             DrawView, AdornerLocalObject {DrawAdorner}, 
  295.             AdornAfter, AdornerSignatureAndClassname {'comp', "", 'comp', freeOnDeletion, $"02"}}}, emptyUserArea, 
  296.         ScrollerScrollBar {mVScrollBarHit, notHilited, notDimmed, sizeable, noInset, 1000, dontPreferOutline, v, 0, 0, 0}, 
  297.         NoSubviews}
  298.     }
  299. };
  300.  
  301. resource 'View' (1002, purgeable) {MAThreeOh, 
  302.     {
  303.     ViewSignatureAndClassname
  304.         {'dflt', 62, "", 'DFLT', enabled, noIdle, {}, MAThreeOh, 
  305.         {0, 0}, {150, 320}, sizeFixed, sizeFixed, shown, doesntWantToBeTarget, 
  306.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  307.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  308.         NoDrawingEnvironment {}, 
  309.         NoAdorners {}, emptyUserArea, 
  310.         View {}, 
  311.         NoSubviews}
  312.     }
  313. };
  314.  
  315.  
  316. resource 'View' (1007, purgeable) {MAThreeOh, 
  317.     {
  318.     ViewSignatureAndClassname
  319.         {'fwnd', 214, "TFloatWindow", 'TWND', enabled, noIdle, {}, MAThreeOh, 
  320.         {80, 80}, {kLightPaletteHeight, kLightPaletteWidth}, sizeFixed, sizeFixed, shown, doesntWantToBeTarget, 
  321.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  322.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  323.         NoDrawingEnvironment {}, 
  324.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  325.             AdornFirst, AdornerLocalObject {EraseAdorner}, 
  326.             DrawView, AdornerLocalObject {DrawAdorner}}}, emptyUserArea, 
  327.         FloatWindow {kWindoidWDEF + kWindoidNotResizable, noID, goAwayBox, notResizable, doFirstClick, 
  328.             dontFreeOnClosing, dontDisposeOnFree, doesntCloseDocument, dontOpenWithDocument, dontAdaptToScreen, dontStagger, forceOnScreen, 
  329.             dontCenter, floats, hidesOnSuspend, doesntGenerateActivates, filler, 1006, 1}, 1}, 
  330.     ViewSignatureAndClassname
  331.         {'view', 75, "TLightPalette", 'TPLT', enabled, noIdle, {}, MAThreeOh, 
  332.         {0, 0}, {kLightPaletteHeight, kLightPaletteWidth}, sizeFixed, sizeFixed, shown, doesntWantToBeTarget, 
  333.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  334.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  335.         NoDrawingEnvironment {}, 
  336.         NoAdorners {}, emptyUserArea, 
  337.         View {}, 
  338.         NoSubviews}
  339.     }
  340. };
  341.